package leetcode.offer;

/**
 * ClassName: ReplaceSpace
 * Description:
 * date: 2021-10-31 22:03
 *
 * @author liyifan
 */
public class ReplaceSpace {
    public String replaceSpace(String s) {
        char[] chars = s.toCharArray();
        StringBuffer buffer = new StringBuffer();
        for (Character c:chars){
            if (c == ' ') {
                buffer.append("%20");
            } else {
                buffer.append(c);
            }
        }
        return buffer.toString();
    }
}
